package com.example.drug.service.impl;

import com.example.drug.domain.Drug;
import com.example.drug.mapper.DrugMapper;
import com.example.drug.service.DrugService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * 药品服务实现类
 *
 * @author [你的名字]
 * @date [具体日期]
 */
@Service
public class DrugServiceImpl implements DrugService {

    @Autowired
    private DrugMapper drugMapper;

    @Override
    public List<Drug> selectAllDrugs() {
        return drugMapper.selectAllDrugs();
    }

    @Override
    public List<Drug> selectDrugByParam(String drugName) {
        return drugMapper.selectDrugByParam(drugName);
    }

    @Override
    public Drug selectDrugById(Long id) {
        return drugMapper.selectDrugById(id);
    }

    @Override
    public int insertDrug(Drug drug) {
        return drugMapper.insertDrug(drug);
    }

    @Override
    public int updateDrug(Drug drug) {
        return drugMapper.updateDrug(drug);
    }

    @Override
    public int deleteDrugById(Long id) {
        return drugMapper.deleteDrugById(id);
    }
}